<?php
defined('_JEXEC') or die('Restricted access');
$tmpl = "templates/tpl_automobil/";
$db = JFactory::getDBO();
?>
<script type="text/javascript" src="<?php echo $tmpl;?>js/tooltips.js"></script>
<script type="text/javascript" src="<?php echo $tmpl;?>js/jquery.filestyle.js"></script>
<script type="text/javascript">
	jQuery(function() { 
		jQuery("input.file_1").filestyle({ 
		 image:"images/bt_browse.jpg",
		 imageheight : 29,
		 imagewidth : 80,
		 width : 220
 		});
	});
</script>

<link rel="stylesheet" href="<?php echo $tmpl;?>css/jquery.ui.all.css"/>
<script src="<?php echo $tmpl;?>js/jquery.ui.core.js"></script>
<script src="<?php echo $tmpl;?>js/jquery.ui.widget.js"></script>
<script src="<?php echo $tmpl;?>js/jquery.ui.datepicker.js"></script>
<script type="text/javascript" src="<?php echo $tmpl;?>js/jquery.ui.datepicker-da.js"></script>
<link rel="stylesheet" href="<?php echo $tmpl;?>css/datepicker.css"/>
<script>
$(function() {
	$( ".datepicker,.datepicker1" ).datepicker({
			changeMonth: true,
			changeYear: true
		});	
	
});
$(document).ready(function(){
	checkNum = function(){
		if($('#nejnum').is(':checked')){ 
			$('#carid').attr('disabled','disabled');
		}
		if($('#janum').is(':checked')){
			$('#carid').removeAttr('disabled');
		}
	}
	submitCar = function(){
		document.getElementById('sendInformationCar').click();
	}
	
	changeBrowse = function(stt) { 
		jQuery("input.file_"+stt).filestyle({ 
		 image:"images/bt_browse.jpg",
		 imageheight : 29,
		 imagewidth : 80,
		 width : 220
 		});
	}
	$('.moreUpload').click(function(e) {
        var num = $('#imageNum').val();
		stt = parseInt(num) + 6;
		html = '<label>Billede '+stt+':</label><fieldset><input type=\"file\" class=\"file_'+stt+'\ fileinput" name=\"imageadd'+num+'\"/></fieldset>';
		$('#moreField').append(html);
		changeBrowse(stt);
		$('#imageNum').val(parseInt(num)+1);
    });
});
</script>
<script language="javascript">
jQuery(document).ready(function(cash) { 
  	jQuery("#infoCar").validate({
   		errorPlacement: function(error, element) {   
   		},
		invalidHandler: function(form, validator) {
			var errors = validator.numberOfInvalids();
			if (errors) {
				$('#alert').html(validator['errorList'][0]['message']);
				$('#backoverlay').show();
				$('#show_popup').show();
				$('#f_focus').html(validator['errorList'][0]['element'].name);
				validator['errorList'][0]['element'].focus();
			} else {
			}
   		},
   		rules: {
			model : "required",
			chassis : "required",
			desired_price : "required",
			register_day : "required",
			view_day : "required",
			km : "required"
   		},
   		messages: {
			model: "Venligst vælg mærke/model",
			chassis: "Venligst oplys stelnummer",
			desired_price: "Venligst oplys din forventet hammerslagspris",
			register_day: "Venligst oplys 1st reg. dato",
			view_day: "Venligst oplys seneste syn",
			km: "Venligst oplys Km.stand"
   		}
  	}); 
	   
});
</script>
<p><span class="float_left f28">Tilmelding af bil</span><span class="link-login"><a href="index.php?option=com_user&view=user&layout=profile&Itemid=13">
  <?php if($user->guest==0) {echo  "Min Profil";} ;?>
  </a><a href="index.php?option=com_user&view=login&task=logout&Itemid=13" class="m12l">
  <?php if($user->guest==0) {echo  "Log ud";};?>
  </a></span></p>
<div class="cb"></div>
<div class="tt m10b"></div>
<div class="box_gude p10l p30b">
    <div class="w720 form_tilmelding1 float_left">
    	<div class="form_tilmelding w462 float_left">
    		<h3 class="boder_b_d m10b">Tilmelding af bil</h3>
            <form name="infoCar" id="infoCar" method="post" enctype="multipart/form-data">
            <input type="hidden" name="placering" value="Dansk Automobil Børs" />
            <input type="submit" name="sendInformationCar" id="sendInformationCar" style="display:none" />
            <input type="hidden" name="option" value="com_ecommerce" />
            <input type="hidden" name="task" value="registerCar" />
        
            <label style="line-height:14px;">Tilmelding af bilen Biltype:<span>*</span></label>
            <select style="text-align:center;" class="w305" name="car_type">
                <option value="Personbil">Personbil</option>
                <option value="Varevogn momsfri">Varevogn momsfri</option>
                <option value="Varevogn + moms">Varevogn + moms</option>
            </select>
            
            <label>Mærke/Model:<span>*</span></label>
            <input name="model" type="text" class="txt_tilmelding w390" id="model" />
            <label>Brændstof:<span>*</span></label>
            <select style="text-align:center;"  class="w305" name="fuel">
                <option value="Benzin">Benzin</option>
                <option value="Diesel">Diesel</option>
            </select>
            <label>Stelnummer:<span>*</span></label>
            <input name="chassis" type="text" class="txt_tilmelding w390" id="chassis" />
            <label style="width:190px;">Din forventet hammerslagspris:<span>*</span></label>
            <input name="desired_price" type="text" class="txt_tilmelding" id="desired_price" style="width:170px; text-align:center;" /> <span style="line-height:29px; color:#000">DKK</span>
     		<div class="cb"></div>
     		<div class="m10t m10b" style="overflow:hidden;">
        		<p style="line-height:14px;" class="float_left">Har nummerplader:</p>
                <div class="float_left m12l">
                    <input name="rdbHar" type="radio" value="Ja" checked="checked" id="janum" onchange="checkNum();"/><span class="pblack"> Ja &nbsp; &nbsp;</span>
                    <input name="rdbHar" type="radio" value="Nej" id="nejnum" onchange="checkNum();"/><span class="pblack"> Nej</span>
                </div>
     		</div>
    		<div class="cb"></div>
            <label style="line-height:14px;">Registerings-<br/>nummer</label>
            <input name="carid" id="carid" type="text" class="txt_tilmelding w390" />
            
            <label>1st Reg.:<span>*</span></label>
            <input id="register_day" name="register_day" type="text" class="txt_tilmelding w390 datepicker" value="" style="background:url('<?php echo $tmpl;?>images/calendar.gif') right no-repeat; cursor:pointer;" />
            
            <label>Seneste syn:<span>*</span></label>
            <input id="view_day" name="view_day" type="text" class="txt_tilmelding w390 datepicker1" value="" style="background:url('<?php echo $tmpl;?>images/calendar.gif') right no-repeat; cursor:pointer;" />
             <label>Skal synes:<span>*</span></label> 
             <select style="text-align:center;" name="registry">
                <option value="Ja">Ja</option>
                <option value="Nej">Nej</option>
            </select>
    		<div class="cl"></div>
            <label>Stand/Kategori:<span>*</span></label>
            <select style="text-align:center;" name="stand">
                <option value="A">A</option>
            	<option value="B">B</option>
            	<option value="UK">UK</option>
            </select>
            <div class="tooltip-eps" ><img src="<?php echo $tmpl;?>images/ico_info.png" alt="" /> 
                <div class="wrapper-tooltip">            
                    <div class="tooltip-top"></div>
                    <div class="tooltip-content">
                    	<?php 
							$db->setQuery("SELECT title, introtext FROM #__content WHERE id = 17");
							$stand_note = $db->loadObject();
							?>
                         <h6><?php echo $stand_note->title;?></h6>
                         <?php echo $stand_note->introtext;?>
                    </div>
                    <div class="tooltip-bottom"></div>
                </div>
			</div>
            <div class="cl"></div>
            <label>Km.stand:<span>*</span></label>
            <input name="km" type="text" class="txt_tilmelding w300" value="" id="km" />
            <label>Information:</label>
            <textarea name="comment" cols="" rows=""></textarea>
    		<div class="cb m10t"></div>
    		<label></label>
    		<span>(Max. 2MB pr billede)</span>
    		<div class="cb"></div>
    		<label>Billede 1:</label>
            <fieldset>
                  <input type="file" class="file_1 fileinput" name="image"/>
                <div class="cb"></div>
              </fieldset>
            <label>Billede 2:</label>
            <fieldset>
                  <input type="file" class="file_1 fileinput" name="image1"/>
                <div class="cb"></div>
              </fieldset>
            <label>Billede 3:</label>
            <fieldset>
                  <input type="file" class="file_1 fileinput" name="image2"/>
                <div class="cb"></div>
              </fieldset>
            <label>Billede 4:</label>
            <fieldset>
                  <input type="file" class="file_1 fileinput" name="image3"/>
              </fieldset>
            <label>Billede 5:</label>
            <fieldset>
                  <input type="file" class="file_1 fileinput" name="image4"/>
              </fieldset>
              <div id="moreField"></div>
              <div class="cb m10t"></div>
              <img src="templates/tpl_automobil/images/btn_more_upload.jpg" class="moreUpload" style="cursor:pointer;" />
              <input type="hidden" id="imageNum" name="imageNum" value="0" />
              <div class="cb m10t"></div>
            Indsæt videolink eller youtube indlejring link:
            <input name="video" type="text" class="txt_tilmelding" value="" id="video" style="width:390px;" />
    		<div class="cb m15t"></div>
    		<a href="javascript:void(0);" class="bt_send1 float_left" onclick="submitCar();"></a>
    	</div>
    	<div class="rightcol-auto">
            <h3 class="boder_b_d">Sikkerhed</h3>
            <table width="303" cellspacing="0" cellpadding="0" border="0" class="m3b">
              <tbody><tr>
                <td><input type="checkbox" id="abs" name="abs"/>
                  <label for="checkbox">ABS-bremser</label></td>
                <td><input type="checkbox" id="alarm" name="alarm"/>
                  <label for="checkbox">Alarm</label></td>
              </tr>
              <tr>
                <td><input type="checkbox" id="antispin" name="antispin"/>
                  <label for="checkbox">Antispin</label></td>
                <td><input type="checkbox" id="start" name="start"/>
                  <label for="checkbox">Startspærre</label></td>
              </tr>
              <tr>
                <td><input type="checkbox" id="esp" name="esp"/>
                  <label for="checkbox">ESP / ESC</label><!--<a class="tooltip-eps" href="javascript:void(0);"> <img src="<?php echo $tmpl;?>images/ico_info.png" alt="" /> 
                    <div class="wrapper-tooltip">            
                        <div class="tooltip-top"></div>
                        <div class="tooltip-content">
                        	<?php 
							$db->setQuery("SELECT title, introtext FROM #__content WHERE id = 18");
							$esp_note = $db->loadObject();
							?>
                             <h6><?php echo $esp_note->title;?></h6>
                             <?php echo $esp_note->introtext;?>
                        </div>
                        <div class="tooltip-bottom"></div>
                    </div>
            </a>--></td>
                <td>
                  <label for="checkbox">Airbags (min.) </label>
                  <select style="text-align:center;" name="airbag">
                    <option value="0">0</option>
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5">5</option>
                    <option value="6">6</option>
                    <option value="7">7</option>
                    <option value="8">8</option>
                    <option value="9">9</option>
                    <option value="10">10</option>
                    <option value="11">11</option>
                    <option value="12">12</option>
                    <option value="13">13</option>
                    <option value="14">14</option>
                 </select>
                </td>
              </tr>
            </tbody>
            </table>
            <div class="cb m10t"></div>
            <h3 class="boder_b_d">Interiør</h3>
            <table width="303" cellspacing="0" cellpadding="0" border="0" class="m3b">
              <tbody><tr>
                <td><input type="checkbox" id="armrest" name="armrest"/>
                  <label for="checkbox">Armlæn</label></td>
                <td><input type="checkbox" id="split_seat" name="split_seat"/>
                  <label for="checkbox">Splitbagsæde</label></td>
              </tr>
              <tr>
                <td><input type="checkbox" id="wood" name="wood"/>
                  <label for="checkbox">Træinteriør</label></td>
                <td><input type="checkbox" id="leather_steering" name="leather_steering"/>
                  <label for="checkbox">Læderrat</label></td>
              </tr>
              <tr>
               
                <td style="width:140px;" colspan="2">
                  <label for="checkbox">Sædebetræk  </label>
                  <select style="text-align:center;" name="seat_cover">
                    <option value="Stof">Stof</option>
                    <option value="Dellæder">Dellæder</option>
                    <option value="Læder">Læder</option>
                 </select>
                </td>
              </tr>
            </tbody>
            </table>
            <div class="cb m10t"></div>
            <h3 class="boder_b_d">Komfort</h3>
            <table width="303" cellspacing="0" cellpadding="0" border="0" class="m3b">
              <tbody><tr>
                <td><input type="checkbox" id="air_con" name="air_con"/>
                  <label for="checkbox">Aircondition</label></td>
                <td><input type="checkbox" id="elec_mirror" name="elec_mirror"/>
                  <label for="checkbox">Elsidespejle</label></td>
              </tr>
              <tr>
                <td><input type="checkbox" id="sensor" name="sensor"/>
                  <label for="checkbox">Parkeringssensor</label></td>
                <td><input type="checkbox" id="elc_heat_mirror" name="elc_heat_mirror"/>
                  <label for="checkbox">Elspejle med varme</label></td>
              </tr>
              <tr>
                <td><input type="checkbox" id="elec_seat" name="elec_seat"/>
                  <label for="checkbox">Elsæder</label></td>
                <td><input type="checkbox" id="radio" name="radio"/>
                  <label for="checkbox">Radio med cd</label></td>
              </tr>
            
            <tr>
                <td><input type="checkbox" id="central" name="central"/>
                  <label for="checkbox">Centrallås</label></td>
                <td><input type="checkbox" id="cruise" name="cruise"/>
                  <label for="checkbox">Fartpilot</label></td>
              </tr>
            
            <tr>
                <td><input type="checkbox" id="servo" name="servo"/>
                  <label for="checkbox">Servo</label></td>
                <td><input type="checkbox" id="remote" name="remote"/>
                  <label for="checkbox">Centrallås fjernb.</label></td>
              </tr>
            
            
                <tr>
                <td><input type="checkbox" id="gps" name="gps"/>
                  <label for="checkbox">GPS-navigation</label></td>
                <td><input type="checkbox" id="sunroof" name="sunroof"/>
                  <label for="checkbox">Soltag</label></td>
              </tr>
            
            
            <tr>
                <td><input type="checkbox" id="power_window" name="power_window"/>
                  <label for="checkbox">Elruder</label></td>
                <td><input type="checkbox" id="air_con1" name="air_con1"/>
                  <label for="checkbox">Klimaanlæg</label></td>
              </tr>
              <tr>
                <td><input type="checkbox" id="elec_sunroof" name="elec_sunroof"/>
                  <label for="checkbox">Soltag elektrisk</label></td>
                <td><input type="checkbox" id="automatic" name="automatic"/>
                  <label for="checkbox">Automatgear</label></td>
              </tr>
            
            <tr>
                <td><input type="checkbox" id="computer" name="computer"/>
                  <label for="checkbox">Kørecomputer</label></td>
                <td><input type="checkbox" id="heated_seat" name="heated_seat"/>
                  <label for="checkbox">Varme i sæder</label></td>
              </tr>
            <tr>
                <td><input type="checkbox" name="power_steering" id="power_steering">
                  <label for="checkbox">Servostyring</label></td>
                <td><input type="checkbox" name="bak_sensor" id="bak_sensor">
                  <label for="checkbox">Bak-sensor (PDC)</label></td>
              </tr>
              <tr>
                <td><input type="checkbox" name="elec_adj_seat" id="elec_adj_seat">
                  <label for="checkbox">El-indstillelige sæder</label></td>
                <td><!--<input type="checkbox" name="heated_mirror" id="heated_mirror">
                  <label for="checkbox">Varme i spejle</label>--></td>
              </tr>
            </tbody>
            </table>
            <div class="cb m10t"></div>
            <h3 class="boder_b_d">Udvendigt</h3>
            <table width="303" cellspacing="0" cellpadding="0" border="0" class="m3b">
              <tbody><tr>
                <td><input type="checkbox" id="towbar" name="towbar"/>
                  <label for="checkbox">Anhængertræk</label></td>
                <td><input type="checkbox" id="lower" name="lower"/>
                  <label for="checkbox">Sænket undervogn</label></td>
              </tr>
              <tr>
                <td><input type="checkbox" id="fog_light" name="fog_light"/>
                  <label for="checkbox">Tågelygter</label></td>
                <td><input type="checkbox" id="removable_towbar" name="removable_towbar"/>
                  <label for="checkbox">Anhæng. aftageligt</label></td>
              </tr>
              <tr>
                <td><input type="checkbox" id="xenon" name="xenon"/>
                  <label for="checkbox">Xenonlygter</label></td>
                <td><input type="checkbox" id="roof_rail" name="roof_rail"/>
                  <label for="checkbox">Tagræling</label></td>
              </tr>
              <tr>
                <td><input type="checkbox" name="lamp_washer" id="lamp_washer">
                  <label for="checkbox">Lygtevasker</label></td>
                <td><input type="checkbox" name="spoiler" id="spoiler">
                  <label for="checkbox">Spoiler</label></td>
              </tr>
            </tbody>
            </table>
            
    	</div>
        </form>
    </div>
    <p class="cb"></p>
</div>